package br.edu.utfpr.backupTools.view.telas.principal.tabela;

import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

import br.edu.utfpr.backupTools.model.pojo.Backup;
import br.edu.utfpr.backupTools.view.telas.principal.JanelaPrincipal;


public class BackupCellRenderer implements TableCellRenderer{

	BackupCellComponent backupComponent;
	
	public BackupCellRenderer(JanelaPrincipal janelaPrincipal){
		backupComponent = new BackupCellComponent(janelaPrincipal);
	}
	
	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		
		Backup backup = (Backup)value;
		backupComponent.updateData(backup, isSelected, table);
		return backupComponent;
	}

}
